﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:myBoardControls="clr-namespace:myBoard.App.Controls"
    x:Class="myBoard.App.Main"
    xmlns:shaders="clr-namespace:ShaderEffects;assembly=RTTHShaders"
    Title="myBoard.App"
    Background="#00FFFFFF" Foreground="#FD000000" ShowInTaskbar="False" Topmost="True"
        AllowsTransparency="False" WindowStyle="None" ResizeMode="NoResize"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    >
  <Window.Resources>
    <Storyboard x:Key="Intro">
    	<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_root" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
    		<SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#3E000000"/>
    	</ColorAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="Outro">
    	<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_root" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
    		<SplineColorKeyFrame KeyTime="00:00:00.4000000" Value="#00000000"/>
    	</ColorAnimationUsingKeyFrames>
    </Storyboard>
  	<Storyboard x:Key="ShowLocalMagnetsLibrary" AccelerationRatio="0.2" DecelerationRatio="0.8">
  		<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_magnetsContainer" Storyboard.TargetProperty="(FrameworkElement.Margin)">
  			<SplineThicknessKeyFrame KeyTime="00:00:00.5000000" Value="0,-116,0,0"/>
  		</ThicknessAnimationUsingKeyFrames>
  		<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(FrameworkElement.Margin)">
  			<SplineThicknessKeyFrame KeyTime="00:00:00.5000000" Value="0,-235,0,0" KeySpline="0,1,1,1"/>
  		</ThicknessAnimationUsingKeyFrames>
  		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(UIElement.Opacity)">
  			<DiscreteDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
  		</DoubleAnimationUsingKeyFrames>
  		<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(UIElement.Visibility)">
  			<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
  			<DiscreteObjectKeyFrame KeyTime="00:00:00.5000000" Value="{x:Static Visibility.Visible}"/>
  		</ObjectAnimationUsingKeyFrames>
  	</Storyboard>
  	<Storyboard x:Key="HideLocalMagnetsLibrary" AccelerationRatio="0.2" DecelerationRatio="0.8">
  		<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_magnetsContainer" Storyboard.TargetProperty="(FrameworkElement.Margin)">
  			<SplineThicknessKeyFrame KeyTime="00:00:00.5000000" Value="0,0,0,0"/>
  		</ThicknessAnimationUsingKeyFrames>
  		<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(FrameworkElement.Margin)">
  			<SplineThicknessKeyFrame KeyTime="00:00:00.5000000" Value="0,0,0,0" KeySpline="0,1,1,1"/>
  		</ThicknessAnimationUsingKeyFrames>
  		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(UIElement.Opacity)">
  			<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
  		</DoubleAnimationUsingKeyFrames>
  		<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="_topLayer" Storyboard.TargetProperty="(UIElement.Visibility)">
  			<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
  			<DiscreteObjectKeyFrame KeyTime="00:00:00.5000000" Value="{x:Static Visibility.Collapsed}"/>
  		</ObjectAnimationUsingKeyFrames>
  	</Storyboard>
  	<Style x:Key="ButtonFocusVisual">
  		<Setter Property="Control.Template">
  			<Setter.Value>
  				<ControlTemplate>
  					<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2"/>
  				</ControlTemplate>
  			</Setter.Value>
  		</Setter>
  	</Style>
  	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
  		<GradientStop Color="#F3F3F3" Offset="0"/>
  		<GradientStop Color="#EBEBEB" Offset="0.5"/>
  		<GradientStop Color="#DDDDDD" Offset="0.5"/>
  		<GradientStop Color="#CDCDCD" Offset="1"/>
  	</LinearGradientBrush>
  	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
  	<Style x:Key="_hideShowLibButStyle" TargetType="{x:Type Button}">
  		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
  		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
  		<Setter Property="BorderThickness" Value="1"/>
  		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  		<Setter Property="HorizontalContentAlignment" Value="Center"/>
  		<Setter Property="VerticalContentAlignment" Value="Center"/>
  		<Setter Property="Padding" Value="1"/>
  		<Setter Property="Template">
  			<Setter.Value>
  				<ControlTemplate TargetType="{x:Type Button}">
  					<Grid Width="30" Height="30">
  						<Ellipse Fill="#59000000" Stroke="#E5FFFFFF" StrokeThickness="2.5"/>
  						<Path RenderTransformOrigin="0.5,0.5" Fill="#59000000" Stretch="Fill" Stroke="#E5FFFFFF" StrokeDashCap="Flat" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeThickness="2.5" HorizontalAlignment="Center" Margin="0,5,0,5" x:Name="path" VerticalAlignment="Center" Data="M15,4.625 L15,25.259468">
  							<Path.RenderTransform>
  								<TransformGroup>
  									<ScaleTransform ScaleX="1" ScaleY="1"/>
  									<SkewTransform AngleX="0" AngleY="0"/>
  									<RotateTransform Angle="0"/>
  									<TranslateTransform X="0" Y="0"/>
  								</TransformGroup>
  							</Path.RenderTransform>
  						</Path>
  						<Path Fill="#59000000" Stretch="Fill" Stroke="#E5FFFFFF" StrokeDashCap="Flat" StrokeEndLineCap="Round" StrokeStartLineCap="Round" StrokeThickness="2.5" Data="M15,4.625 L15,25.259468" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" x:Name="path1" VerticalAlignment="Center" Height="19.8">
  							<Path.RenderTransform>
  								<TransformGroup>
  									<ScaleTransform ScaleX="1" ScaleY="1"/>
  									<SkewTransform AngleX="0" AngleY="0"/>
  									<RotateTransform Angle="90"/>
  									<TranslateTransform X="0" Y="0"/>
  								</TransformGroup>
  							</Path.RenderTransform>
  						</Path>
  					</Grid>
  					<ControlTemplate.Triggers>
  						<Trigger Property="ToggleButton.IsChecked" Value="true"/>
  					</ControlTemplate.Triggers>
  				</ControlTemplate>
  			</Setter.Value>
  		</Setter>
  	</Style>
  	<Style x:Key="AboutButStyle" TargetType="{x:Type Button}">
  		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
  		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
  		<Setter Property="BorderThickness" Value="1"/>
  		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  		<Setter Property="HorizontalContentAlignment" Value="Center"/>
  		<Setter Property="VerticalContentAlignment" Value="Center"/>
  		<Setter Property="Padding" Value="1"/>
  		<Setter Property="Template">
  			<Setter.Value>
  				<ControlTemplate TargetType="{x:Type Button}">
  					<ControlTemplate.Resources>
  						<Storyboard x:Key="MouseOverAnimation">
  							<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="label" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
  								<SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="-30"/>
  								<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="30"/>
  								<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
  							</DoubleAnimationUsingKeyFrames>
  						</Storyboard>
  					</ControlTemplate.Resources>
  					<Grid Width="30" Height="30">
  						<Ellipse Fill="#59000000" Stroke="#E5FFFFFF" StrokeThickness="2.5" x:Name="ellipse"/>
  						<Label RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" x:Name="label" VerticalAlignment="Center" Content="?" FontFamily="Arial" FontSize="20" Foreground="#FFEAEAEA">
  							<Label.RenderTransform>
  								<TransformGroup>
  									<ScaleTransform ScaleX="1" ScaleY="1"/>
  									<SkewTransform AngleX="0" AngleY="0"/>
  									<RotateTransform Angle="0"/>
  									<TranslateTransform X="0" Y="0"/>
  								</TransformGroup>
  							</Label.RenderTransform>
  						</Label>
  					</Grid>
  					<!--<ControlTemplate.Triggers>
  						<Trigger Property="IsMouseOver" Value="True">
  							<Setter Property="Cursor" TargetName="ellipse" Value="Hand"/>
  						</Trigger>
  					</ControlTemplate.Triggers>-->
  				</ControlTemplate>
  			</Setter.Value>
  		</Setter>
  	</Style>
  </Window.Resources>

<!--  xmlns:shaders="clr-namespace:ShaderEffects;assembly=RTTHShaders"-->

  <Grid x:Name="_root" Background="#00000000">
<!--    <Grid.Effect>
      <shaders:DesaturateEffect x:Name="ScaleEffect" ScaleFactor="1"/>
    </Grid.Effect>-->
    <StackPanel x:Name="_magnetsBoard">
      <Canvas x:Name="_magnetsContainer" Width="{Binding Path=ActualWidth, ElementName=_root, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=_root, Mode=Default}" Background="{x:Null}">
      	<Image x:Name="_fakeBgImage" Width="Auto" Height="Auto" Margin="0,114,0,0"/>
      </Canvas>
      <myBoardControls:LocalMagnetsExplorer Width="Auto" x:Name="_localMagnetsExplorer"/>
		</StackPanel>
  	<Button RenderTransformOrigin="0.5,0.5" x:Name="_aboutBut" Style="{DynamicResource AboutButStyle}" Content="Button" HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="30" Height="40" Background="{x:Null}" Cursor="Hand">
  		<Button.RenderTransform>
  			<TransformGroup>
  				<ScaleTransform ScaleX="1" ScaleY="1"/>
  				<SkewTransform AngleX="0" AngleY="0"/>
  				<RotateTransform Angle="0"/>
  				<TranslateTransform X="0" Y="0"/>
  			</TransformGroup>
  		</Button.RenderTransform>
  	</Button>
  	<Canvas x:Name="_topLayer" Width="{Binding Path=ActualWidth, ElementName=_root, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=_root, Mode=Default}" Background="{x:Null}" Opacity="0" Visibility="Collapsed"/>
	</Grid>
</Window>
